using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace Charisma.MongoDb.Linq.Expressions
{
  public class DocumentExpression : MongoExpression
  {
    public Dictionary<string, object> Document { get; private set; }

    public override bool CanReduce
    {
      get { return false; }
    }

    protected override Expression Accept(ExpressionVisitor visitor)
    {
      throw new NotSupportedException();
    }

    protected override Expression VisitChildren(ExpressionVisitor visitor)
    {
      throw new NotSupportedException();
    }

    public DocumentExpression(Dictionary<string, object> document)
      : base(MongoExpressionType.Document, typeof(Dictionary<string,object>))
    {
      Document = document;
    }
  }
}